package com.cet.designpatterns.visitor;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-09-19 23:35
 **/
public class Client {
    public static void main(String[] args) {
        ObjectStructure objectStructure = new ObjectStructure();
        Man man = new Man();
        objectStructure.attach(man);
        Success success = new Success();
        Fail fail = new Fail();
        objectStructure.display(success);
        System.out.println("------------------------");
        objectStructure.detach(man);
        objectStructure.attach(new Woman());
        objectStructure.display(fail);
    }
}
